<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*"%>
<%@ page import="xml.response.*"%>
<%@ page import="xml.root"%>
<%@ page import="util.print.printLogCat"%>
<%@ page import="org.sql.table.*"%>
<%@ page import="xml.var"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="jqgrid.jqgrid"%>
<%@ page import="org.util.getNewData"%>
<%@ page import="requestInterFace.Handle.*"%>
<%@ page import="org.util.SerialNumberUtil"%>
<%@ include file="../../util/paramPrint.jsp" %>
<%@ page trimDirectiveWhitespaces="true" %> 
<%
String Advice_Title = request.getParameter("Advice_Title");
String Advice_Content= request.getParameter("Advice_Content");
String Advice_Type = request.getParameter("Advice_Type");
String userType=(String)session.getAttribute("User_Type");
String userID=(String)session.getAttribute("User_ID");
root root=new root();
if(userType==null||userType.equals("")){
root.setStatus("false");
root.setMsg("你还未登录");
//PrintWriter pw = response.getWriter();
//pw.println(root.getXmlString());
//pw.flush();
//return ;
}

 		if(Advice_Title==null||Advice_Title.equals("")){
		root.setStatus("false");
		root.setMsg("请输入标题");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
		}
		
		   /* adviceHandle handle=new adviceHandle();
			if(handle.isUser(userID,Advice_Title)){
				root.setStatus("false");
				root.setMsg("标题已存在");
				PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
			}*/
		
		adviceinfo1_1 user=new adviceinfo1_1();

		if(Advice_Title!=null&&(!Advice_Title.equals(""))){
		 user.setInsertField("Advice_Title", Advice_Title);
		}
		if(Advice_Content!=null&&(!Advice_Content.equals(""))){
		 user.setInsertField("Advice_Content", Advice_Content);
		}
		if(Advice_Type!=null&&!Advice_Type.equals("")){
		 user.setInsertField("Advice_Type",Advice_Type);
		}
		user.setInsertField("Advice_AddTime",getNewData.GetNowDateAndTime1());
		user.setInsertField("User_ID",userID);
		user.setInsertField("UP_ID",(String)session.getAttribute("UP_ID"));
		int row=user.insert();
		root.setRecords(""+row);//设置当前查询到的记录数
		if(row>0){
			root.setStatus("true");
			root.setMsg("添加成功");
		}
		//printLogCat.printlnWriter(root.getXmlString());
		String rep=root.getXmlString();
%>
<%=rep%>

